<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<input type="button" value="按钮" id="btn"/>
<div id="dv1">
    <p>哈哈，你别是个傻子吧</p>
    <p>哈哈，你别是个傻子吧</p>
    <p>哈哈，你别是个傻子吧</p>
    <p>哈哈，你别是个傻子吧</p>
    <p>哈哈，你别是个傻子吧</p>
</div>
<div id="dv2">
    <p>嘎嘎</p>
    <p>嘎嘎</p>
    <p>嘎嘎</p>
    <p>嘎嘎</p>
</div>
<script>
    document.getElementById("btn").onclick = function () {
        var pObjs = document.getElementById("dv1").getElementsByTagName("p")
        for (var i = 0; i < pObjs.length; i++) {
            pObjs[i].innerText = "我们都是傻子";
        }
    };

</script>
</body>
</html>